/**
 * 主题色 Mixin 测试文件
 * 用于验证 themeColorMixin 是否正常工作
 */

// 模拟 uni-app 环境
const mockUni = {
  setStorageSync: (key, value) => {
    console.log('Mock setStorageSync:', key, value)
  }
}

// 模拟全局对象
global.uni = mockUni
global.document = {
  documentElement: {
    style: {
      setProperty: (prop, value) => {
        console.log('Mock CSS setProperty:', prop, value)
      }
    }
  }
}

// 导入 mixin
const themeColorMixin = require('../mixins/themeColorMixin.js')

console.log('=== 主题色 Mixin 测试 ===')
console.log('Mixin 导入成功:', !!themeColorMixin.default)
console.log('包含的方法:', Object.keys(themeColorMixin.default.methods || {}))
console.log('包含的计算属性:', Object.keys(themeColorMixin.default.computed || {}))
console.log('包含的数据属性:', Object.keys(themeColorMixin.default.data() || {}))

// 测试 hexToRgb 方法
if (themeColorMixin.default.methods && themeColorMixin.default.methods.hexToRgb) {
  const testColors = ['#4A90E2', '#FF0000', '#00FF00', '#0000FF']
  console.log('\n=== hexToRgb 方法测试 ===')
  testColors.forEach(color => {
    const rgb = themeColorMixin.default.methods.hexToRgb(color)
    console.log(`${color} -> RGB(${rgb.r}, ${rgb.g}, ${rgb.b})`)
  })
}

console.log('\n测试完成！')